using GameFramework.Localization;
using UnityEngine;
using UnityGameFramework.Runtime;

namespace LS.Localization
{
    public static class LocalizationExtension
    {
        public static SystemLanguage ToSystemLanguage(this Language language)
        {
            switch (language)
            {
                case Language.Afrikaans: return SystemLanguage.Afrikaans;
                case Language.Arabic: return SystemLanguage.Arabic;
                case Language.Basque: return SystemLanguage.Basque;
                case Language.Belarusian: return SystemLanguage.Belarusian;
                case Language.Bulgarian: return SystemLanguage.Bulgarian;
                case Language.Catalan: return SystemLanguage.Catalan;
                case Language.ChineseSimplified: return SystemLanguage.ChineseSimplified;
                case Language.ChineseTraditional: return SystemLanguage.ChineseTraditional;
                case Language.Czech: return SystemLanguage.Czech;
                case Language.Danish: return SystemLanguage.Danish;
                case Language.Dutch: return SystemLanguage.Dutch;
                case Language.English: return SystemLanguage.English;
                case Language.Estonian: return SystemLanguage.Estonian;
                case Language.Faroese: return SystemLanguage.Faroese;
                case Language.Finnish: return SystemLanguage.Finnish;
                case Language.French: return SystemLanguage.French;
                case Language.German: return SystemLanguage.German;
                case Language.Greek: return SystemLanguage.Greek;
                case Language.Hebrew: return SystemLanguage.Hebrew;
                case Language.Hungarian: return SystemLanguage.Hungarian;
                case Language.Icelandic: return SystemLanguage.Icelandic;
                case Language.Indonesian: return SystemLanguage.Indonesian;
                case Language.Italian: return SystemLanguage.Italian;
                case Language.Japanese: return SystemLanguage.Japanese;
                case Language.Korean: return SystemLanguage.Korean;
                case Language.Latvian: return SystemLanguage.Latvian;
                case Language.Lithuanian: return SystemLanguage.Lithuanian;
                case Language.Norwegian: return SystemLanguage.Norwegian;
                case Language.Polish: return SystemLanguage.Polish;
                case Language.PortuguesePortugal: return SystemLanguage.Portuguese;
                case Language.Romanian: return SystemLanguage.Romanian;
                case Language.Russian: return SystemLanguage.Russian;
                case Language.SerboCroatian: return SystemLanguage.SerboCroatian;
                case Language.Slovak: return SystemLanguage.Slovak;
                case Language.Slovenian: return SystemLanguage.Slovenian;
                case Language.Spanish: return SystemLanguage.Spanish;
                case Language.Swedish: return SystemLanguage.Swedish;
                case Language.Thai: return SystemLanguage.Thai;
                case Language.Turkish: return SystemLanguage.Turkish;
                case Language.Ukrainian: return SystemLanguage.Ukrainian;
                case Language.Unspecified: return SystemLanguage.Unknown;
                case Language.Vietnamese: return SystemLanguage.Vietnamese;
                default: return SystemLanguage.Unknown;
            }
        }

        public static Language ToLanguage(SystemLanguage language)
        {
            switch (language)
            {
                case UnityEngine.SystemLanguage.Afrikaans: return Language.Afrikaans;
                case UnityEngine.SystemLanguage.Arabic: return Language.Arabic;
                case UnityEngine.SystemLanguage.Basque: return Language.Basque;
                case UnityEngine.SystemLanguage.Belarusian: return Language.Belarusian;
                case UnityEngine.SystemLanguage.Bulgarian: return Language.Bulgarian;
                case UnityEngine.SystemLanguage.Catalan: return Language.Catalan;
                case UnityEngine.SystemLanguage.Chinese: return Language.ChineseSimplified;
                case UnityEngine.SystemLanguage.ChineseSimplified: return Language.ChineseSimplified;
                case UnityEngine.SystemLanguage.ChineseTraditional: return Language.ChineseTraditional;
                case UnityEngine.SystemLanguage.Czech: return Language.Czech;
                case UnityEngine.SystemLanguage.Danish: return Language.Danish;
                case UnityEngine.SystemLanguage.Dutch: return Language.Dutch;
                case UnityEngine.SystemLanguage.English: return Language.English;
                case UnityEngine.SystemLanguage.Estonian: return Language.Estonian;
                case UnityEngine.SystemLanguage.Faroese: return Language.Faroese;
                case UnityEngine.SystemLanguage.Finnish: return Language.Finnish;
                case UnityEngine.SystemLanguage.French: return Language.French;
                case UnityEngine.SystemLanguage.German: return Language.German;
                case UnityEngine.SystemLanguage.Greek: return Language.Greek;
                case UnityEngine.SystemLanguage.Hebrew: return Language.Hebrew;
                case UnityEngine.SystemLanguage.Hungarian: return Language.Hungarian;
                case UnityEngine.SystemLanguage.Icelandic: return Language.Icelandic;
                case UnityEngine.SystemLanguage.Indonesian: return Language.Indonesian;
                case UnityEngine.SystemLanguage.Italian: return Language.Italian;
                case UnityEngine.SystemLanguage.Japanese: return Language.Japanese;
                case UnityEngine.SystemLanguage.Korean: return Language.Korean;
                case UnityEngine.SystemLanguage.Latvian: return Language.Latvian;
                case UnityEngine.SystemLanguage.Lithuanian: return Language.Lithuanian;
                case UnityEngine.SystemLanguage.Norwegian: return Language.Norwegian;
                case UnityEngine.SystemLanguage.Polish: return Language.Polish;
                case UnityEngine.SystemLanguage.Portuguese: return Language.PortuguesePortugal;
                case UnityEngine.SystemLanguage.Romanian: return Language.Romanian;
                case UnityEngine.SystemLanguage.Russian: return Language.Russian;
                case UnityEngine.SystemLanguage.SerboCroatian: return Language.SerboCroatian;
                case UnityEngine.SystemLanguage.Slovak: return Language.Slovak;
                case UnityEngine.SystemLanguage.Slovenian: return Language.Slovenian;
                case UnityEngine.SystemLanguage.Spanish: return Language.Spanish;
                case UnityEngine.SystemLanguage.Swedish: return Language.Swedish;
                case UnityEngine.SystemLanguage.Thai: return Language.Thai;
                case UnityEngine.SystemLanguage.Turkish: return Language.Turkish;
                case UnityEngine.SystemLanguage.Ukrainian: return Language.Ukrainian;
                case UnityEngine.SystemLanguage.Unknown: return Language.Unspecified;
                case UnityEngine.SystemLanguage.Vietnamese: return Language.Vietnamese;
                default: return Language.Unspecified;
            }
        }

    }
}
